﻿using System;
using System.Collections.Generic;
using System.Text;
using BCMS.Business.DataContract;

namespace BCMS.DAL.IDAL
{
    public interface ICoupon
    {
        void BeginADOTransaction();
        void RollBackTransaction();
        void CommitADOTransaction();
        void Open(string connString);
        void Close();

        List<CouponInfo> getCouponsByClaim(int? claimBy, string serial, DateTime from, DateTime to);

        int insertCoupon(string serial, DateTime start, DateTime expire, decimal parValue, int status, string note, int releaseId, bool isCanceled);

        List<CouponInfo> getCoupons(string serial, int status);

        List<CouponInfo> findClaimedCouponsBySeries(DateTime smaller, DateTime greater, int claimby);

        int claimCouponBySerial(string serial, int userid, string note, DateTime claimDate);

        int undoClaimCouponBySerial(string serial);

        int extendCouponBySerial(string serial, string note, DateTime expireDate);

        CouponInfo getCouponBySerial(string serial);

        void disposelCouponByReleaseId(int releaseId, int disposeStatus, int normalSatus);

        void deleteCouponBySerial(string serial);

        void deleteCouponByReleaseId(int releaseId);

        void cancelCouponBySerial(string serial);

        int countCouponByRelease(int releaseId);

        List<CouponInfo> reportExpiredUnClaimed(DateTime fromDate, DateTime toDate, DateTime reportDate); //expired unclaim
        List<CouponInfo> reportUnexpiredUnclaimed(DateTime fromDate, DateTime toDate, DateTime reportDate);

        List<CouponBrief> reportClaimedCoupons(DateTime fromDate, DateTime toDate);

        List<CouponBrief> reportClaimedCouponsByUser(int claimBy, DateTime fromDate, DateTime toDate);

        List<CouponBrief> reportExpireCoupons(DateTime reportDate);

        List<CouponBrief> reportUnExpireCoupons(DateTime reportDate);

        List<CouponBrief> reportCouponsByReleaseDate(DateTime fromDate, DateTime toDate);
    }
}
